package com.bank.user.configuration;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * The type Mybatis plus config.
 *
 * @author Cejay1314
 * @version 1.0
 * @create 2022 /12/4 13:21
 */
@Configuration
@EnableTransactionManagement
public class MybatisPlusConfig {
    /**
     * Optimistic locker interceptor optimistic locker interceptor.CExceptionCaptureAspect
     *
     * @return the optimistic locker interceptor
     */
//注册乐观锁插件
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor(){
        return new OptimisticLockerInterceptor();
    }
}
